﻿<UserControl x:Class="IsikFx.Project.ClientApp.Content.DeleteAnnouncement"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Style x:Key="DataGridContentCellCentering" TargetType="{x:Type DataGridCell}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}">
                            <ContentPresenter VerticalAlignment="Center" />
                            <ContentPresenter HorizontalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <DataGrid Height="Auto" 
          Name="dataAnnouncements"  CellStyle="{ StaticResource DataGridContentCellCentering}"  RowHeaderWidth="0" Loaded="dataAnnouncements_Loaded_1" BorderThickness="1" 
          BorderBrush="Black" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top" Width="Auto" AlternatingRowBackground="AliceBlue" 
          AutoGenerateColumns="False" HorizontalAlignment="Stretch" CanUserAddRows="False"  AlternationCount="2" GridLinesVisibility="All"  HeadersVisibility="All" SelectionMode="Single" 
                  SelectionUnit="Cell" ClipboardCopyMode="None" HorizontalGridLinesBrush="#FF020202" VerticalGridLinesBrush="Black" RowBackground="#FFCBCBCB" >
            <DataGrid.Columns>
                <DataGridTextColumn  Width="*" IsReadOnly="True" Binding="{Binding announcement.AnnouncementTitle}" Header="Başlık" MinWidth="0"  />
                <DataGridTextColumn Width="*" IsReadOnly="True"  Binding="{Binding announcement.AnnouncementContent}" Header="Duyuru" />
                <DataGridTextColumn Width="*" IsReadOnly="True" Binding="{Binding personelType}"  Header="Hedef Personel" />
                <DataGridTextColumn Width="*" IsReadOnly="True" Binding="{Binding announcement.CreateDate}" Header="Duyuru Tarihi" />

                <DataGridTemplateColumn Width="SizeToCells" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Button Content="Sil" Click="Button_Click_1"/>
                            </StackPanel>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>


        </DataGrid>

    </Grid>
</UserControl>
